package chloroform

import javax.servlet.http.{HttpServletResponse, HttpServletRequest, HttpServlet}
import argo.jdom.JsonRootNode
import util.JsonUtils

/**
 * Created by IntelliJ IDEA.
 * User: zslajchrt
 * Date: 7.3.11
 * Time: 16:48
 * To change this template use File | Settings | File Templates.
 */
class PreCookieServlet extends HttpServlet {
//
//  def getPreConfigSession(req: HttpServletRequest) = {
//    val session = req.getSession
//    var preConfigSession = session.getAttribute(classOf[PreConfigSession].getName).asInstanceOf[PreConfigSession]
//    if (preConfigSession == null) {
//      val configPageRegister = ConfigPageRegisterLookup.getConfigPageRegister(req)
//      preConfigSession = new PreConfigSession(configPageRegister)
//      session.setAttribute(classOf[PreConfigSession].getName, preConfigSession)
//    }
//    preConfigSession
//  }
//
//  override def doPost(req: HttpServletRequest, resp: HttpServletResponse) = {
//    val preConfigSession = getPreConfigSession(req)
//
//    val responseCookie: JsonRootNode = JsonUtils.parser.parse(req.getReader)
//    val renderer: Renderer = preConfigSession.processResponse(responseCookie)
//    JsonUtils.renderResponse(resp, renderer)
//
//  }
}